/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.ulohy.uloha3.managers;

import cz.muni.fi.pb138.ulohy.uloha3.entities.RealEstate;
import cz.muni.fi.pb138.ulohy.uloha3.exceptions.RealEstateManagerException;
import java.util.Set;
import javax.sql.DataSource;

/**
 *
 * @author stefan
 */
public interface RealEstateManager {
    
    /**
     * 
     * @param realEstate  {@link RealEstate} to be added
     * @throws RealEstateManagerException if realestate is {@code null}, 
     *          if realestate.catastralId, realestate.type or realestate.address is {@code null} 
     *          or if there was an SQLException
     */
    public void addRealEstate(RealEstate realEstate) throws RealEstateManagerException;
    
    /**
     * 
     * @param realEstate {@link RealEstate} to be edited
     */
    public void editRealEstate(RealEstate realEstate) throws RealEstateManagerException;
    
    /**
     * 
     * @param realEstate {@link RealEstate} to be deleted
     */
    public void deleteRealEstate(RealEstate realEstate) throws RealEstateManagerException;
    
    /**
     * 
     * @return <code>List</code> of all the {@link RealEstate}s
     */
    public Set<RealEstate> listRealEstates() throws RealEstateManagerException;
    
    /**
     * 
     * @param id Id of the RealEstate to return
     * @return
     * @throws RealEstateManagerException if id is null
     */
    public RealEstate getRealEstateById(Long id) throws RealEstateManagerException;

    public void setDataSource(DataSource datasource);
    
}
